<div class="flex-wrap">
  <%= render "menu" %>
  <div class="col-12 col-md-9">
    <%= form_for(Setting.new, url: admin_settings_path) do |f| %>
      <div class="sub-title"><%= t(".System settings") %></div>
      <input type="hidden" name="_action" value="show" />
      <div class="form-group">
        <label class="control-label"><%= t(".Host") %></label>
        <%= f.text_field :host, value: Setting.host, class: "form-control", placeholder: "http://localhost"  %>
        <div class="form-text">
          <%= raw t(".BlueDoc application host_html") %>
        </div>
      </div>

      <div class="form-group form-checkbox">
        <label>
          <%= f.check_box :anonymous_enable, checked: Setting.anonymous_enable? %>
          <%= t(".Enable anonymous visit public contents") %>
        </label>
        <div class="form-text">
          <%= t(".Disable this BlueDoc will requirement sign in for all pages") %>
        </div>
      </div>

      <div class="form-group form-checkbox">
        <label>
          <%= f.check_box :captcha_enable, checked: Setting.captcha_enable? %>
          <%= t(".Enable captcha") %>
        </label>
        <div class="form-text">
          <%= t(".Check to enable captcha for protected some important form") %>
        </div>
      </div>

      <% feature_for(:limit_user_emails) do %>
      <div class="form-group">
        <label class="control-label"><%= t(".Account Email suffix") %></label>
        <%= f.text_area :user_email_suffixes, value: Setting.user_email_suffixes.join("\n"), class: "form-control", style: "height: 100px; min-height: 100px"  %>
        <div class="form-text">
          <%= t(".Limit user registration email must has suffx with in this list, empty it to allow any emails_html") %>
        </div>
      </div>
      <% end %>

      <div class="form-group form-checkbox">
        <label>
          <%= f.check_box :confirmable_enable, checked: Setting.confirmable_enable? %>
          <%= t(".Require Email confirm for new account") %>
        </label>
      </div>

      <div class="form-group">
        <label class="control-label"><%= t(".PlantUML Service Host") %></label>
        <%= f.text_field :plantuml_service_host, value: Setting.plantuml_service_host, class: "form-control", placeholder: "http://localhost:1608"  %>
        <div class="form-text">
          <%= raw t(".BlueDoc use plantuml-service for generate PlantUML SVG image, change this config to can use a custom service of your deployment", link: link_to("plantuml-service", "https://github.com/bitjourney/plantuml-service", target: "_blank")) %>
        </div>
      </div>

      <div class="form-group">
        <label class="control-label"><%= t(".MathJax Service Host") %></label>
        <%= f.text_field :mathjax_service_host, value: Setting.mathjax_service_host, class: "form-control", placeholder: "http://localhost:4010"  %>
        <div class="form-text">
          <p><%= raw t(".If you wants customize MaxJax SVG service") %></p>
        </div>
      </div>

      <div class="form-group">
        <label class="control-label"><%= t(".Admin Emails") %></label>
        <%= f.text_area :admin_emails, value: Setting.admin_emails.join("\n"), class: "form-control", style: "height: 100px; min-height: 100px"  %>
        <div class="form-text">
          <%= t(".Special account emails as admin with each line") %>
        </div>
      </div>

      <% feature_for :ldap_auth do %>
        <% if Setting.ldap_enable? %>
        <div class="ldap-auth-fields">
          <div class="form-group">
            <label class="control-label"><%= t(".LDAP Name") %></label>
            <%= f.text_field :ldap_name, value: Setting.ldap_name, class: "form-control"  %>
            <div class="form-text">
              <%= t(".Display name of LDAP_html") %>
            </div>
          </div>

          <div class="form-group">
            <label class="control-label"><%= t(".LDAP Title") %></label>
            <%= f.text_field :ldap_title, value: Setting.ldap_title, class: "form-control"  %>
            <div class="form-text">
              <%= t(".For customize the LDAP Login button title and page title_html") %>
            </div>
          </div>

          <div class="form-group">
            <label class="control-label"><%= t(".LDAP Description") %></label>
            <%= f.text_area :ldap_description, value: Setting.ldap_description, class: "form-control"  %>
            <div class="form-text">
              <%= t(".Customize the LDAP Login page description_html") %>
            </div>
          </div>
        </div>
        <% end %>
      <% end %>

      <div class="form-action">
        <%= f.submit t(".Save"), class: "btn btn-primary mr-1" %>
      </div>
    <% end %>
  </div>
</div>
